package loginFlash
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.events.Event;
	
	[SWF(width="1000",height="600",backgroundColor="#000000")]
	public class Login2 extends Sprite
	{
		[Embed(source="assets/other/back.png")]
		private var pic:Class;
		[Embed(source="assets/other/background.jpg")]
		private var pic0:Class;
		[Embed(source="assets/other/image1.png")]
		private var pic1:Class;
		[Embed(source="assets/other/image2.png")]
		private var pic2:Class;
		[Embed(source="assets/other/image3.png")]
		private var pic3:Class;
		[Embed(source="assets/other/image4.png")]
		private var pic4:Class;
		[Embed(source="assets/other/image5.png")]
		private var pic5:Class;
		
		private var gen1:Bitmap,gen2:Bitmap,gen3:Bitmap,gen4:Bitmap,gen5:Bitmap,background:Bitmap,back:Bitmap;
		
		private var genObj:Object;
		
		public function Login2()
		{
			super();
			init();
			this.addEventListener(Event.ENTER_FRAME,onEnterFrame);
		}
		
		public function onEnterFrame(event:Event):void {
			
			background.x += (-(mouseX-stage.stageWidth/2)/(stage.stageWidth/2)*50+genObj[0].x - background.x)*.1;
			
			gen1.x += (-(mouseX-stage.stageWidth/2)/(stage.stageWidth/2)*15+genObj[1].x - gen1.x)*.1;
			
			gen2.x += ((mouseX-stage.stageWidth/2)/(stage.stageWidth/2)*20+genObj[2].x - gen2.x)*.1;
			
			gen3.x += ((mouseX-stage.stageWidth/2)/(stage.stageWidth/2)*20+genObj[3].x - gen3.x)*.1;
			
			gen4.x += ((mouseX-stage.stageWidth/2)/(stage.stageWidth/2)*40+genObj[4].x - gen4.x)*.1;
			
			gen5.x += ((mouseX-stage.stageWidth/2)/(stage.stageWidth/2)*40+genObj[5].x - gen5.x)*.1;
		}
		
		public function init():void {
			
			
			
			gen1 = new pic1() as Bitmap;
			gen2 = new pic2() as Bitmap;
			gen3 = new pic3() as Bitmap;
			gen4 = new pic4() as Bitmap;
			gen5 = new pic5() as Bitmap;
			background = new pic0() as Bitmap;
			back = new pic() as Bitmap;
			
			
			gen1.x = (stage.stageWidth - gen1.width)/2;
			gen1.y = (stage.stageHeight - gen1.height)/2;
			
			gen2.x = gen1.x - 20;
			
			gen3.x = gen1.x + 115;
			
			gen4.x = gen2.x - 270;
			gen5.x = gen3.x + 340;
			
			gen5.y = gen4.y = gen3.y = gen2.y = gen1.y;
			gen5.y -= 70;
			
			background.x = (stage.stageWidth - background.width)/2;
			
			this.addChild(background);
			this.addChild(gen5);
			this.addChild(gen4);
			this.addChild(gen3);
			this.addChild(gen2);
			this.addChild(gen1);
			this.addChild(back);
			
			genObj = [
				{x:background.x,y:background.y},
				{x:gen1.x,y:gen1.y},
				{x:gen2.x,y:gen2.y},
				{x:gen3.x,y:gen3.y},
				{x:gen4.x,y:gen4.y},
				{x:gen5.x,y:gen5.y}
			];
		}
	}
}